
import returnOrder from '@/api/eims/returnOrderAPI'
import Mixins from '@/views/mixins'
export default {
  data () {
    return {
      visibleDetailPanel: false,
      visibleCreatePanel: false,
      rowInfo: {}
    }
  },
  mixins: [Mixins],
  computed: {
    returnTypes () {
      return this.getReturnTypes()
    },
    returnStatus () {
      return this.getReturnStatus()
    }
  },
  methods: {
    getRequestType (opt) {
      if (this.id === 'salesOrderReturn') {
        return returnOrder.getSalesReturnOrderListAPI
      } else if (this.id === 'purchaseOrderReturn') {
        return returnOrder.getPurchaseReturnOrderListAPI
      }
    },
    toCreate () {
      this.visibleCreatePanel = true
    },
    toDetail (row) {
      this.visibleDetailPanel = true
      this.rowInfo = row
    }
  }
}
